package model.publics;
// Generated Oct 25, 2012 2:07:57 PM by Hibernate Tools 3.2.1.GA


import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

/**
 * MstSupplier generated by hbm2java
 */
@Entity
@Table(name="mst_supplier", schema="public")
@Cache(usage=CacheConcurrencyStrategy.READ_WRITE)
public class Supplier implements java.io.Serializable {

    private int id;
    private String kode;
    private String nama;
    private String alamat;
    private String kota;
    private String kodePos;
    private String phone;
    private String fax;
    private String website;
    private String email;
    private String kontak;
    private String disabledLog;
    private String insertedLog;
    private String updatedLog;
    private Suprincipal suprincipal;

    public Supplier() {
         this.suprincipal = new Suprincipal();
    }
	
    public Supplier(int id) {
        this.id = id;
    }
    
    public Supplier(int id, String kode, String nama, String alamat, String kota, String kodePos, String phone, String fax, String website, String email, String kontak, String disabledLog, String insertedLog, String updatedLog, Suprincipal suprincipal) {
       this.id = id;
       this.kode = kode;
       this.nama = nama;
       this.alamat = alamat;
       this.kota = kota;
       this.kodePos = kodePos;
       this.phone = phone;
       this.fax = fax;
       this.website = website;
       this.email = email;
       this.kontak = kontak;
       this.disabledLog = disabledLog;
       this.insertedLog = insertedLog;
       this.updatedLog = updatedLog;
       this.suprincipal = suprincipal;
    }
   
    @Id 
    @SequenceGenerator(name="supplier_seq", sequenceName="mst_supplier_id_seq", allocationSize=1)
    @GeneratedValue(strategy= GenerationType.SEQUENCE, generator="supplier_seq")
    @Column(name="id", unique=true, nullable=false)
    public int getId() {
        return this.id;
    }
    
    public void setId(int id) {
        this.id = id;
    }
    
    @Column(name="kode", length=20)
    public String getKode() {
        return this.kode;
    }
    
    public void setKode(String kode) {
        this.kode = kode;
    }
    
    @Column(name="nama", length=100)
    public String getNama() {
        return this.nama;
    }
    
    public void setNama(String nama) {
        this.nama = nama;
    }
    
    @Column(name="alamat", length=250)
    public String getAlamat() {
        return this.alamat;
    }
    
    public void setAlamat(String alamat) {
        this.alamat = alamat;
    }
    
    @Column(name="kota", length=50)
    public String getKota() {
        return this.kota;
    }
    
    public void setKota(String kota) {
        this.kota = kota;
    }
    
    @Column(name="kode_pos", length=6)
    public String getKodePos() {
        return this.kodePos;
    }
    
    public void setKodePos(String kodePos) {
        this.kodePos = kodePos;
    }
    
    @Column(name="phone", length=50)
    public String getPhone() {
        return this.phone;
    }
    
    public void setPhone(String phone) {
        this.phone = phone;
    }
    
    @Column(name="fax", length=50)
    public String getFax() {
        return this.fax;
    }
    
    public void setFax(String fax) {
        this.fax = fax;
    }
    
    @Column(name="website", length=50)
    public String getWebsite() {
        return this.website;
    }
    
    public void setWebsite(String website) {
        this.website = website;
    }
    
    @Column(name="email", length=50)
    public String getEmail() {
        return this.email;
    }
    
    public void setEmail(String email) {
        this.email = email;
    }
    
    @Column(name="kontak", length=50)
    public String getKontak() {
        return this.kontak;
    }
    
    public void setKontak(String kontak) {
        this.kontak = kontak;
    }
    
    @Column(name="disabled_log", length=50)
    public String getDisabledLog() {
        return this.disabledLog;
    }
    
    public void setDisabledLog(String disabledLog) {
        this.disabledLog = disabledLog;
    }
    
    @Column(name="inserted_log", length=50)
    public String getInsertedLog() {
        return this.insertedLog;
    }
    
    public void setInsertedLog(String insertedLog) {
        this.insertedLog = insertedLog;
    }
    
    @Column(name="updated_log", length=50)
    public String getUpdatedLog() {
        return this.updatedLog;
    }
    
    public void setUpdatedLog(String updatedLog) {
        this.updatedLog = updatedLog;
    }
    /**
     *
     * @return
     */
    @OneToOne(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="supplier")
    public Suprincipal getSuprincipal() {
        return suprincipal;
    }

    public void setSuprincipal(Suprincipal suprincipal) {
        this.suprincipal = suprincipal;
    }
   /* 
    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final MstSupplier other = (MstSupplier) obj;
        if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 59 * hash + (this.id != null ? this.id.hashCode() : 0);
        return hash;
    }

*/


}


